home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
tlx_hst.zip
/
TLX_HST.SLT
< prev
next >
Wrap
Text File
|
1988-12-15
|
54KB
|
1,626 lines
////////////////////////////////////////////////////////////////////////
// //
// TLX_HST Service Script, Release 1.0 //
// //
// For Telix SALT version 3.11 //
// //
// Written by: Andrzej Taramina //
// //
////////////////////////////////////////////////////////////////////////
int CONT_OK = 0; // Global function return codes
int GET_OUT = 99;
int TIME_OUT = 98;
main()
{
str menu[1] = "M";
str rom_level[3] = "";
str func[2];
int save_scr;
int t1, t2, t3, t4;
int stat;
int ret_code = 0;
int ran_fn;
int time_handle;
save_scr = vsavearea(0,0,79,24);
clear_scr();
if (carrier())
{
clear_scr();
prints("This Script MUST be run OFFLINE (in terminal mode)");
prints("Script aborted due to above error.");
delay(40);
vrstrarea(save_scr);
return(-1);
}
t1 = track("961",0);
t2 = track("963",0);
t3 = track("964",0);
t4 = track("OK",0);
flushbuf();
cputs("ATI0^M");
time_handle = timer_start(20);
while (1)
{
terminal();
stat = track_hit(0);
if (stat == t1)
{
rom_level = "961";
break;
}
else if (stat == t2)
{
rom_level = "963";
break;
}
else if (stat == t3)
{
rom_level = "964";
break;
}
else if (stat == t4)
break;
else if (time_up(time_handle))
break;
}
track_free(0);
timer_free(time_handle);
if (rom_level == "")
{
clear_scr();
prints("Sorry, your modem is not a USRobotics Courier HST or");
prints("the ROM level is higher than 964 or lower than 961.");
prints("HST Service Script aborted.");
delay (40);
vrstrarea(save_scr);
return(-1);
}
cputs("AT&B0^M");
set_cparams(2400,0,8,1);
_local_echo = 1;
while (ret_code == CONT_OK)
{
if (menu == "M")
main_menu(rom_level);
else
adv_menu(rom_level);
ran_fn = 1;
flushbuf();
gotoxy(56,18);
gets(func,2);
if (menu == "M")
{
if (func == "1") ret_code = get_level();
else if (func == "2") ret_code = chk_sum();
else if (func == "3") ret_code = ram_test();
else if (func == "4") ret_code = current_set();
else if (func == "5") ret_code = nram_set();
else if (func == "6") ret_code = set_clock();
else if (func == "7") ret_code = disp_phone();
else if (func == "8") ret_code = basic_help();
else if (func == "9") ret_code = ext_help();
else if (func == "10") ret_code = dial_help();
else if (func == "11") ret_code = set_sregs();
else if (func == "12") ret_code = switch_help();
else if (func == "13") ret_code = interface_test();
else if (func == "14") ret_code = analog_loop();
else if (func == "15") ret_code = freq_test();
else if (func == "16") ret_code = data_mode();
else if (func == "17") ret_code = set_to_nram();
else if (func == "18") ret_code = write_nram();
else if (func == "19") ret_code = dial_phone();
else if (func == "20") ret_code = link_diag();
else if (func == "TX") ret_code = telix_def(rom_level);
else if (func == "tx") ret_code = telix_def(rom_level);
else if (func == "PC") ret_code = pcboard_def(rom_level);
else if (func == "pc") ret_code = pcboard_def(rom_level);
else if ((func == "AD" or func == "ad") and
rom_level >= "964")
{
menu = "A";
ran_fn = 0;
continue;
}
else if (func == "99") break;
else
{
tone(400,50);
ran_fn = 0;
}
}
if (menu == "A")
{
if (func == "50") ret_code = disable_comp();
else if (func == "51") ret_code = auto_comp();
else if (func == "52") ret_code = enable_comp();
else if (func == "53") ret_code = set_s15reg();
else if (func == "54") ret_code = set_rate();
else if (func == "55") ret_code = modem_inq();
else if (func == "98")
{
menu = "M";
ran_fn = 0;
}
else if (func == "99") break;
else
{
tone(400,50);
ran_fn = 0;
}
}
if (ran_fn and ret_code == CONT_OK)
{
gotoxy(18,23);
printsc("Press (Enter) to return to function menu......");
flushbuf();
gotoxy(0,0);
inkeyw();
}
}
if (ret_code == TIME_OUT)
{
clear_scr();
prints("WAITFOR timeout: expected response not received after 20 seconds");
prints("Script aborted....");
delay(30);
}
clear_scr();
gotoxy(0,0);
prints("USR TLX_HST SERVICE SCRIPT - EXIT");
prints(" ");
prints("The TLX_HST script sets your COM port to 2400-N-8-1 during");
prints("its operation and resets these parameters to 19200-N-8-1");
prints("prior to exit. If your default COM parameters are different,");
prints("Use the TELIX Alt-P command to restore the desired COM ");
prints("parameters before going back online.");
prints(" ");
prints("Thanks for using TLX_HST and TELIX. Have a nice day.");
prints(" ");
prints("Press <Enter> to return to Telix");
inkeyw();
set_cparams(19200,0,8,1);
_local_echo = 1;
vrstrarea(save_scr);
return(0);
}
////////////////////////////////////////////////////////////////////////
// //
// Function to display Main Menu //
// //
////////////////////////////////////////////////////////////////////////
main_menu(str rom_level)
{
clear_scr();
prints(" ┌────────────────────────────────────────────┐ ");
prints(" ╒═════════════╡ USR COURIER HST - TXL_HST MAIN MENU v1.0 ╞═════════════╕");
prints(" │ └────────────────────────────────────────────┘ │");
prints(" │ 1. Display HST ROM Level 13. Check Modem-PC Interface │");
prints(" │ 2. Display HST Memory Checksum 14. Self-Test: Analog Loopback │");
prints(" │ 3. HST RAM Test 15. Self-Test: Answer Frequency │");
prints(" │ 4. Display HST RAM Settings 16. Self-Test: Reset Data Mode │");
prints(" │ 5. Display HST NRAM Settings 17. Reset Modem to NRAM Default │");
prints(" │ 6. Display/Set Internal TOD Clock 18. Copy RAM Settings to NRAM │");
prints(" │ 7. Display/Store Internal Phone #s 19. Dial a number & exit │");
prints(" │ 8. Display Basic Command Help 20. Link Diagnostics display │");
prints(" │ 9. Display Extended Command Help │");
prints(" │ 10. Display Dial Command Help │");
prints(" │ 11. Display S-Reg Help/Set S-Reg TX. Set Telix 3.11 defaults │");
prints(" │ 12. Display Modem Switch Help PC. Set PCboard 14.x defaults │");
prints(" │ 99. EXIT │");
prints(" ╞═══════════════════════